# Copyright 2009 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

include $(GOROOT)/src/Make.$(GOARCH)

TARG=bsb
MAIN=bench

GOFILES=\
        sort.go\
        bsearch.go\

main: fmt package
	$(GC) -I_obj $(MAIN).go
	$(LD) -L_obj -o $(MAIN) $(MAIN).$O
	@echo "Done. Executable is: $(MAIN)"

fmt:
	gofmt -w $(GOFILES) $(MAIN).go 

distclean:
	make clean
	rm $(MAIN)

run: allbench fastbench

i = 1 2 3 4 5 6 7 8
allbench: main
	@-$(foreach i, $(i), /bin/echo -n allbench${i};time ./bench -s=${i};)

j= 5 6 7 8
fastbench: main
	@-$(foreach j, $(j), /bin/echo -n fastbench${j};time ./bench -s=${i} -N=100000000;)

include $(GOROOT)/src/Make.pkg
